package day04;

import java.util.Scanner;

public class Guessing {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = (int) (Math.random() * 100 + 1);
        System.out.println("请输入您的数字：");
    /*    int guess = scan.nextInt();
        while(guess!=n){
            if(guess>n){
                System.out.println("猜大了，继续猜：");
            }else{
                System.out.println("猜小了，继续猜：");
            }
            guess = scan.nextInt();
        }
        System.out.println("恭喜您！！！猜对了！！！！");
        System.out.println(n);

         */
        while (true) {
            int guess = scan.nextInt();
            if (guess > n) {
                System.out.println("猜大了，继续猜：");
            } else if (guess < n) {
                System.out.println("猜小了，继续猜：");
            } else {
                System.out.println("恭喜您！！！猜对了！！！！");
                break;
            }
        }

    }
}
